import React, { PureComponent } from "react"
import { Link, Outlet, useNavigate } from "react-router-dom"
import { withRouter } from "../hoc"

export class Home extends PureComponent {
    navigateTo(path) {
        this.props.router.navigate(path)
    }

    render() {
        return (
            <div>
                <h1>Home Page</h1>
                <Link to="/home/recommend">歌曲推荐</Link>
                <Link to="/home/ranking">歌曲排行榜</Link>
                <button onClick={() => this.navigateTo("/home/songmenu")}>歌曲菜单</button>
                <Outlet></Outlet>
            </div>
        )
    }
}


export default withRouter(Home)
